<?php


namespace App\Http\Controllers;

use App\Business\ImageController;
use App\Business\Stan;
use App\Http\Requests\StoreBlogPost;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redis;

class UserController
{


    /**
     * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
     */
    public function addTest()
    {
        return view('addTest');
    }



    /**
     * @param StoreBlogPost $request
     * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
     */
    public function add(StoreBlogPost $request)
    {
        $data = $request->all();
        $image = $request->file('image')->getPathname();
        return ImageController::image($image,$data);
    }


    /**
     * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
     */
    public function page()
    {
        $res = Stan::user()->get();
        return view('page',['res'=>$res]);
    }



    /**
     * @return false|string|void
     */
    public function del()
    {

//        取得ID字段
        $id = request('id');
        return \App\Business\UserController::del($id);
    }



    /**
     * @return false|string
     */
    public function showList()
    {
       return  \App\Business\UserController::showList();
    }
}
